<!doctype html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Example - example-ng-model-cancel-update-debug</title>
  

  <script src="../../../angular.js"></script>
  <script src="app.js"></script>
  

  
</head>
<body ng-app="cancel-update-example">
  <div ng-controller="CancelUpdateController">
  <p>Try typing something in each input.  See that the model only updates when you
     blur off the input.
   </p>
   <p>Now see what happens if you start typing then press the Escape key</p>

  <form name="myForm" ng-model-options="{ updateOn: 'blur' }">
    <p id="inputDescription1">With $rollbackViewValue()</p>
    <input name="myInput1" aria-describedby="inputDescription1" ng-model="myValue"
           ng-keydown="resetWithCancel($event)"><br/>
    myValue: "{{ myValue }}"

    <p id="inputDescription2">Without $rollbackViewValue()</p>
    <input name="myInput2" aria-describedby="inputDescription2" ng-model="myValue"
           ng-keydown="resetWithoutCancel($event)"><br/>
    myValue: "{{ myValue }}"
  </form>
</div>
</body>
</html>